package pv.smallxy.bungeefriend;

import net.md_5.bungee.config.Configuration;

import java.io.*;
import java.sql.ResultSet;

public class configManager extends main {
    private main plugin;

    private Configuration config;

    public configManager(main plugin) throws IOException {
        System.out.println("你居然没有死了妈的config.yml");
        this.plugin = plugin;
        createc();
    }

    public void createc() throws IOException {
        InputStream is = configManager.class.getResourceAsStream("config.yml");
        File folder = this.plugin.getDataFolder();
        if (!folder.exists())
            folder.mkdir();
        File configFile = new File("pv/smallxy/bungeefriend/config.yml");
        OutputStream os = new FileOutputStream(configFile);
        int index = 0;
        byte[] bytes = new byte[1024];
        while (!((index = is.read(bytes)) != -1)) {
           os.write(bytes, 0, index);
        }
        os.close();
        os.flush();
        is.close();
        System.out.println("死了妈的config.yml给你了");
    }


    public void loadc() {
        System.out.println("加载死了妈的config.yml");
    }

    public void reloadc() {

    }

    public void getConfig() {
        return this.config;
    }
}
